﻿using UnityEngine;
using System.Collections;

public class RandomMoving : MonoBehaviour {
	float time = 0.0f;
	float interval = 1.0f;
	void Update () {
		if (Time.time - time > interval)
		{
			rigidbody2D.velocity = new Vector2(Random.Range(-2,2), 0);
			time = Time.time;
		}
	}
}
